package com.easthome.controller;

import com.easthome.entity.Person;
import com.easthome.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author cxiaoy
 * @Date 2022/10/14 10:53
 */
@Controller
@RequestMapping("/aa")
public class Controller01 {

    @Autowired
    private PersonService personService;

    @RequestMapping("test1")
    public String test1(Model model){
        System.out.println("test1...");
        List<Person> list = personService.findAll();
        model.addAttribute("personList",list);
        return "index";
    }

}
